package cn.itcast.feign.client;

import cn.itcast.feign.config.DefaultFeignConfiguration;
import cn.itcast.feign.pojo.Result;
import cn.itcast.feign.pojo.User;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.*;

@FeignClient(value = "user-service",
        configuration = DefaultFeignConfiguration.class)
public interface UserClient {
    @GetMapping("/users")
    public User getById(@RequestParam Long userId);

    @DeleteMapping("/users/userId")
    public Result delete(@PathVariable Long userId);

    @PostMapping("/users/add")
    public Result insert(@RequestBody User user);

    @PutMapping("/users/edit")
    public Result update(@RequestBody User user);
}
